<?php 

$db = Zend_Db_Table_Abstract::getDefaultAdapter();

$menusite = $db->fetchAll('SELECT SQL_CACHE * FROM ST_MENU WHERE MET_STA = 1 ORDER BY MET_ORD ASC');

$fullbanner = $db->fetchAll('SELECT SQL_CACHE * FROM FULLBANNER WHERE BAN_STA = 1 ORDER BY BAN_ORD ASC');

?>
<?php
$arr_jav = '';
$img_ini = '';
foreach ($fullbanner as $key => $obj) {
    $img = glob('public/upload/fullbanner/' . $obj['BAN_ID'] . '.*');
    $arr_jav .= '"' . @$this->urlbase.'/'.$img[0] . '",';
    if ($key == 0)
        $img_ini = @$img[0];
}
if (strlen($arr_jav) > 2) {
    substr($arr_jav, 0, -1);
    echo '<script>var imgs = [' . $arr_jav . '];</script>';
}
?>

<!-- Header -->
<div id="header" pos="0" class="h-banner" style="background-image: url('<?php echo $this->urlbase.'/'.$img_ini; ?>');">

    <!-- Inner -->
    <div class="inner">
        <header>
            <h1>Léa Casarin</h1>
            <p>CENTRO DE BELEZA</p>
        </header>
        <?php if($this->controller == 'index'){ ?>
        <footer>
            <a href="#banner" class="button circled scrolly">Iniciar</a>
        </footer>
        <?php } ?>
    </div>

    <!-- Nav -->
    <nav id="nav">
        <ul>
        <?php foreach ($menusite as $menu) { ?>
            <li><a href="<?php echo $this->urlbase.'/'.$menu['MET_LNK']; ?>"><?php echo $menu['MET_NOM']; ?></a></li>
        <?php } ?>
        </ul>
    </nav>

</div>